Skip to content

Conversation

@Roffild
Copy link

@Roffild Roffild commented Jan 30, 2026

Без PATH теперь работает.

Summary by CodeRabbit

  • Bug Fixes
    • Installation scripts now reliably locate and invoke required utilities using absolute paths, improving compatibility across different system configurations and edge cases.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Modified install scripts to use explicit path-qualified invocations instead of relying on PATH environment variables. Changes include updating the oscript binary path resolution and adjusting path quoting conventions in both Unix shell and Windows batch scripts.

Changes

Cohort / File(s) Summary
Shell Script Path Resolution
install/opm
Replaces direct oscript call with $THISDIR/oscript to ensure correct binary invocation, with arguments passed as $OPM followed by $@.
Batch Script Path Updates
install/opm.bat
Removes quotes from lib path variable assignment and updates oscript invocation to use quoted absolute path "%~dp0oscript.exe" with properly quoted arguments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A path once lost in dusty PATH,
Now found with clarity!
Scripts now know precisely where,
To hop with certainty,
No more shall binaries astray roam free! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing absolute path execution for OPM so it works without PATH environment variable, which aligns with the modifications to both shell and batch scripts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@install/opm.bat`:
- Line 5: Update the SET assignment for the environment variable named lib so
the assigned path is quoted to handle spaces; locate the line using the SET
command that assigns lib (currently using %~dp0..\lib) and change it to use the
SET syntax that places the entire assignment in quotes (i.e., use the quoted-set
form) so paths containing spaces are preserved safely.

setlocal

set lib="%~dp0..\lib"
set lib=%~dp0..\lib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Quote the SET value for safety with paths containing spaces.

The lib variable assignment is unquoted. If the installation path contains spaces, this will cause issues. The static analysis tool correctly flags this (SEC002).

Proposed fix
-set lib=%~dp0..\lib
+set "lib=%~dp0..\lib"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
set lib=%~dp0..\lib
set "lib=%~dp0..\lib"
🧰 Tools
🪛 Blinter (1.0.102)

[error] 5-5: Unsafe SET command usage. Explanation: SET commands without proper validation or quoting can cause security issues. Recommendation: Always quote SET values and validate input: SET "var=safe value". Context: SET command value should be quoted for safety

(SEC002)

🤖 Prompt for AI Agents
In `@install/opm.bat` at line 5, Update the SET assignment for the environment
variable named lib so the assigned path is quoted to handle spaces; locate the
line using the SET command that assigns lib (currently using %~dp0..\lib) and
change it to use the SET syntax that places the entire assignment in quotes
(i.e., use the quoted-set form) so paths containing spaces are preserved safely.

Copy link
Owner

@EvilBeaver EvilBeaver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я не очень понял мотивацию предлагаемых изменений. Зачем это нужно и в каких ситуациях?

setlocal

set lib="%~dp0..\lib"
set lib=%~dp0..\lib
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кролик прав, зачем убраны кавычки?

OPM=$LIB/opm/src/cmd/opm.os

oscript $OPM "$@"
"$THISDIR/oscript" "$OPM" "$@"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THISDIR указывает на каталог где лежит шеллскрипт и это тот же каталог, где лежит исполняемый файл oscript. Получается, что $THISDIR/oscript аналогично ./oscript

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Или я не понял смысл изменения

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oscript и ./oscript - не одно и то же. Второе будет искать только в текущем каталоге. Первое - в path.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, тут я неверно написал. Но смысл изменения все равно непонятен

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants